home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / circuits / spice2g6.z / spice2g6 / spice / Fortran / ovtpvt.f < prev    next >
Encoding:
Text File  |  1989-02-03  |  6.8 KB  |  246 lines

  1. c spice version 2g.6  sccsid=ovtpvt.ma 3/15/83
  2.       subroutine ovtpvt
  3.       implicit double precision (a-h,o-z)
  4. c
  5. c
  6. c     this routine generates the requested tabular listings of analysis
  7. c results.  it calls plot to generate line-printer plots.
  8. c
  9. c spice version 2g.6  sccsid=tabinf 3/15/83
  10.       common /tabinf/ ielmnt,isbckt,nsbckt,iunsat,nunsat,itemps,numtem,
  11.      1   isens,nsens,ifour,nfour,ifield,icode,idelim,icolum,insize,
  12.      2   junode,lsbkpt,numbkp,iorder,jmnode,iur,iuc,ilc,ilr,numoff,isr,
  13.      3   nmoffc,iseq,iseq1,neqn,nodevs,ndiag,iswap,iequa,macins,lvnim1,
  14.      4   lx0,lvn,lynl,lyu,lyl,lx1,lx2,lx3,lx4,lx5,lx6,lx7,ld0,ld1,ltd,
  15.      5   imynl,imvn,lcvn,nsnod,nsmat,nsval,icnod,icmat,icval,
  16.      6   loutpt,lpol,lzer,irswpf,irswpr,icswpf,icswpr,irpt,jcpt,
  17.      7   irowno,jcolno,nttbr,nttar,lvntmp
  18. c spice version 2g.6  sccsid=cirdat 3/15/83
  19.       common /cirdat/ locate(50),jelcnt(50),nunods,ncnods,numnod,nstop,
  20.      1   nut,nlt,nxtrm,ndist,ntlin,ibr,numvs,numalt,numcyc
  21. c spice version 2g.6  sccsid=status 3/15/83
  22.       common /status/ omega,time,delta,delold(7),ag(7),vt,xni,egfet,
  23.      1   xmu,sfactr,mode,modedc,icalc,initf,method,iord,maxord,noncon,
  24.      2   iterno,itemno,nosolv,modac,ipiv,ivmflg,ipostp,iscrch,iofile
  25. c spice version 2g.6  sccsid=flags 3/15/83
  26.       common /flags/ iprnta,iprntl,iprntm,iprntn,iprnto,limtim,limpts,
  27.      1   lvlcod,lvltim,itl1,itl2,itl3,itl4,itl5,itl6,igoof,nogo,keof
  28. c spice version 2g.6  sccsid=miscel 3/15/83
  29.       common /miscel/ atime,aprog(3),adate,atitle(10),defl,defw,defad,
  30.      1  defas,rstats(50),iwidth,lwidth,nopage
  31. c spice version 2g.6  sccsid=dc 3/15/83
  32.       common /dc/ tcstar(2),tcstop(2),tcincr(2),icvflg,itcelm(2),kssop,
  33.      1   kinel,kidin,kovar,kidout
  34. c spice version 2g.6  sccsid=ac 3/15/83
  35.       common /ac/ fstart,fstop,fincr,skw2,refprl,spw2,jacflg,idfreq,
  36.      1   inoise,nosprt,nosout,nosin,idist,idprt
  37. c spice version 2g.6  sccsid=tran 3/15/83
  38.       common /tran/ tstep,tstop,tstart,delmax,tdmax,forfre,jtrflg
  39. c spice version 2g.6  sccsid=outinf 3/15/83
  40.       common /outinf/ xincr,string(15),xstart,yvar(8),itab(8),itype(8),
  41.      1   ilogy(8),npoint,numout,kntr,numdgt
  42. c spice version 2g.6  sccsid=blank 3/15/83
  43.       common /blank/ value(200000)
  44.       integer nodplc(64)
  45.       complex cvalue(32)
  46.       equivalence (value(1),nodplc(1),cvalue(1))
  47. c
  48.       complex cval
  49.       dimension prform(3)
  50.       dimension subtit(4,3)
  51.       data subtit / 8hdc trans, 8hfer curv, 8hes      , 8h        ,
  52.      1              8htransien, 8ht analys, 8his      , 8h        ,
  53.      2              8hac analy, 8hsis     , 8h        , 8h         /
  54.       data prform / 8h(1pe11.3, 8h,2x,8e00, 8h.00)     /
  55.       data aper,rprn / 1h., 1h) /
  56. c
  57.       call second(t1)
  58.       if (icalc.le.0) go to 1000
  59.       call crunch
  60.       if (nogo.lt.0) go to 1000
  61. c
  62. c  construct format statement to be used for printing the outputs
  63. c
  64.       ifract=max0(numdgt-1,0)
  65.       ifwdth=ifract+9
  66.       ipos=15
  67.       call alfnum(ifwdth,prform,ipos)
  68.       call move(prform,ipos,aper,1,1)
  69.       ipos=ipos+1
  70.       call alfnum(ifract,prform,ipos)
  71.       call move(prform,ipos,rprn,1,1)
  72. c
  73.       noprln=min0(8,(lwidth-12)/ifwdth)
  74.       if (mode-2) 50,60,300
  75.    50 numout=jelcnt(41)+1
  76.       go to 70
  77.    60 numout=jelcnt(42)+1
  78. c
  79. c  dc and transient analysis printing
  80. c
  81.    70 loc=locate(30+mode)
  82.    80 if (loc.eq.0) go to 200
  83.       kntr=min0(noprln,nodplc(loc+3))
  84.       if (kntr.le.0) go to 120
  85.       call title(1,lwidth,1,subtit(1,mode))
  86.       call setprn(loc)
  87. c
  88. c  get buffer space
  89. c
  90.       call getm8(locx,npoint)
  91.       call getm8(locy,kntr*npoint)
  92. c
  93. c  interpolate outputs
  94. c
  95.       call ntrpl8(locx,locy,numpnt)
  96. c
  97. c  print outputs
  98. c
  99.       do 100 i=1,numpnt
  100.       xvar=value(locx+i)
  101.       locyt=locy
  102.       do 90 k=1,kntr
  103.       yvar(k)=value(locyt+i)
  104.       locyt=locyt+npoint
  105.    90 continue
  106.       write (iofile,prform) xvar,(yvar(k),k=1,kntr)
  107.   100 continue
  108.       write (iofile,111)
  109.   111 format(1hy)
  110.       call clrmem(locx)
  111.       call clrmem(locy)
  112.   120 loc=nodplc(loc)
  113.       go to 80
  114. c
  115. c  dc and transient analysis plotting
  116. c
  117.   200 loc=locate(35+mode)
  118.   210 if (loc.eq.0) go to 250
  119.       kntr=nodplc(loc+3)
  120.       if (kntr.le.0) go to 220
  121.       locv=nodplc(loc+1)
  122.       call title(1,lwidth,1,subtit(1,mode))
  123.       call setplt(loc)
  124. c
  125. c     get buffer space
  126. c
  127.       call getm8(locx,npoint)
  128.       call getm8(locy,kntr*npoint)
  129. c
  130. c  interpolate outputs and load plot buffers
  131. c
  132.       call ntrpl8(locx,locy,numpnt)
  133.       call plot(numpnt,locx,locy,locv)
  134.       call clrmem(locx)
  135.       call clrmem(locy)
  136.   220 loc=nodplc(loc)
  137.       go to 210
  138. c
  139. c  fourier analysis
  140. c
  141.   250 if (mode.eq.1) go to 1000
  142.       if (nfour.eq.0) go to 1000
  143.       if (nogo.ne.0) go to 1000
  144.       call fouran
  145.       go to 1000
  146. c
  147. c  ac analysis printing
  148. c
  149.   300 numout=jelcnt(43)+jelcnt(44)+jelcnt(45)+1
  150.       do 599 id=33,35
  151.       loc=locate(id)
  152.   320 if (loc.eq.0) go to 599
  153.       kntr=min0(noprln,nodplc(loc+3))
  154.       if (kntr.le.0) go to 595
  155.       call title(1,lwidth,1,subtit(1,mode))
  156.       call setprn(loc)
  157. c
  158. c  print ac outputs
  159. c
  160.       lout=loutpt
  161.       do 590 i=1,icalc
  162.       xvar=dble(real(cvalue(lout+1)))
  163.       do 500 k=1,kntr
  164.       iseq=itab(k)
  165.       iseq=nodplc(iseq+4)
  166.       cval=cvalue(lout+iseq)
  167.       ktype=itype(k)
  168.       go to (450,450,430,440,450,450), ktype
  169.   430 yvar(k)=dble(real(cval))
  170.       go to 500
  171.   440 yvar(k)=dble(aimag(cval))
  172.       go to 500
  173.   450 call magphs(cval,xmag,xphs)
  174.       go to (460,460,430,440,470,465), ktype
  175.   460 yvar(k)=xmag
  176.       go to 500
  177.   465 yvar(k)=20.0d0*dlog10(xmag)
  178.       go to 500
  179.   470 yvar(k)=xphs
  180.   500 continue
  181.       lout=lout+numout
  182.   580 write (iofile,prform) xvar,(yvar(k),k=1,kntr)
  183.   590 continue
  184.       write (iofile,111)
  185.   595 loc=nodplc(loc)
  186.       go to 320
  187.   599 continue
  188. c
  189. c  ac analysis plotting
  190. c
  191.       do 760 id=38,40
  192.       loc=locate(id)
  193.   610 if (loc.eq.0) go to 760
  194.       kntr=nodplc(loc+3)
  195.       if (kntr.le.0) go to 750
  196.       locv=nodplc(loc+1)
  197.       call title(1,lwidth,1,subtit(1,mode))
  198.       call setplt(loc)
  199. c
  200.       call getm8(locx,icalc)
  201.       call getm8(locy,kntr*icalc)
  202. c
  203. c     load plot buffers
  204. c
  205.       lout=loutpt
  206.       do 710 i=1,icalc
  207.       xvar=dble(real(cvalue(lout+1)))
  208.       locyt=locy
  209.       do 700 k=1,kntr
  210.       iseq=itab(k)
  211.       iseq=nodplc(iseq+4)
  212.       cval=cvalue(lout+iseq)
  213.       ktype=itype(k)
  214.       go to (670,670,650,660,670,670), ktype
  215.   650 yvr=dble(real(cval))
  216.       go to 695
  217.   660 yvr=dble(aimag(cval))
  218.       go to 695
  219.   670 call magphs(cval,xmag,xphs)
  220.       go to (680,680,650,660,690,685), ktype
  221.   680 yvr=dlog10(xmag)
  222.       go to 695
  223.   685 yvr=20.0d0*dlog10(xmag)
  224.       go to 695
  225.   690 yvr=xphs
  226.   695 value(locyt+i)=yvr
  227.       locyt=locyt+icalc
  228.   700 continue
  229.       value(locx+i)=xvar
  230.       lout=lout+numout
  231.   710 continue
  232.       call plot(icalc,locx,locy,locv)
  233.       call clrmem(locx)
  234.       call clrmem(locy)
  235.   750 loc=nodplc(loc)
  236.       go to 610
  237.   760 continue
  238. c
  239. c  finished
  240. c
  241.  1000 call clrmem(loutpt)
  242.       call second(t2)
  243.       rstats(11)=rstats(11)+t2-t1
  244.       return
  245.       end
  246.